<?php
/**
 * Conversations - A lightweight BB for Xaraya
 *
 * @package modules
 * @copyright (C) 2003-2006 The Digital Development Foundation.
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @link http://www.xaraya.com
 *
 * @subpackage conversations
 * @link http://xaraya.com/index.php/release/760.html
 * @author John Cox
*/
/** 
 * Add new tag / post
 * 
 * @package Xaraya eXtensible Management System
 * @copyright (C) 2005 by the Xaraya Development Team.
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @link http://www.xaraya.org
 *
*/

/**
 * @author John Cox
 * @author jojodee
 * add new forum topic
 */

function conversations_user_preview_post_ajax()
{
    if (!xarVarFetch('post', 'str:1', $post, '', XARVAR_NOT_REQUIRED)) return;
    if (!xarSecurityCheck('Postcon', 1)) return;
        
    // TODO
    // This probably needs to go in a template...
    // OK
    

    /* Let any transformation hooks know that we want to transform some text.
     * You'll need to specify the item id, and an array containing the names of all
     * the pieces of text that you want to transform (e.g. for autolinks, wiki,
     * smilies, bbcode, ...).
     */

    $post = xarModCallHooks('item', 'transform', 1, $post, 'conversations', 2);
    $data = xarTplModule('conversations', 'user', 'preview_post', 
        array('post' => $post));
    
    // Return the output
    return $data;
}

?>